<?php
/*
 * @Author: 逅来
 * @Description: 
 * @Date: 2023-03-19 14:55:20
 * @LastEditTime: 2023-03-28 21:08:30
 * @FilePath: \zhaopian.com\application\api\controller\photo\Route.php
 * @email: 934749708@qq.com
 */



namespace app\api\controller\photo;

use app\common\controller\Api;
use app\admin\model\photo\Account as AccountModel;
use app\admin\model\photo\City as CityModel;
use app\admin\model\photo\Route as RouteModel;
use think\Db;

class Route extends Api
{
    // 无需登录的接口,*表示全部
    protected $noNeedLogin = ['*'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    public function succ_ess($number, $text, $title, $list, $data)
    {
        return json(['code' => $number, 'msg' => $text, $title => $list, 'data' => $data]);
    }
    /**
     * @description: 行程路线
     * @return {*}
     * @author: 逅来
     */
    public function index()
    {
        $list = RouteModel::field('id as route_id,city_id')->select();
        foreach($list as $k => &$v){
            $v['route'] = implode(',',Db::name('photo_city')->where('id','in',$v['city_id'])->column('name'));
        }
        $this->success('行程路线', $list);
    }
}
